package org.gd.hellojaxb.privat24.html;

import org.gd.hellojaxb.utils.Marshall;
import org.gd.hellojaxb.utils.MarshallProperties;

import javax.xml.bind.annotation.*;

/**
 * @author User
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement
public class HtmlElement {

    @XmlAttribute(name = "style")
    private String style;
    @XmlAttribute(name = "class")
    private String clazz;
    @XmlAttribute(name = "id")
    private String id;
    @XmlAttribute(name = "name")
    private String name;
    @XmlAttribute(name = "value")
    private String value;
    @XmlValue
    private String content;

    public HtmlElement() {
    }

    public String getStyle() {
        return style;
    }

    public void setStyle(String style) {
        this.style = style;
    }

    public String getClazz() {
        return clazz;
    }

    public void setClazz(String clazz) {
        this.clazz = clazz;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    @Override
    public String toString() {
        try {
            return Marshall.getInstance().marshal(this, MarshallProperties.WITHOUT_XML_HEADER);
        } catch (Throwable e) {
            return super.toString();
        }
    }
}
